package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.Spots;
import cn.wolfcode.wolf2w.service.ISpotsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/spots")
public class SpotsController {

    @Autowired
    private ISpotsService spotsService;

    @GetMapping("/list")
    public Object list(){
        List<Spots> spots = spotsService.selectAll();
        spots.forEach(spots1 -> System.out.println(spots1));
        return spots;
    }
}
